
public class Grid 
{
	private Aminoacido[][] grid;

	public Grid(int n)
	{
		int size = 2 * n;
		this.grid = new Aminoacido[size+2][size+2];
		
		for(int i = 0; i < size+2; i++)
		{
			for (int j = 0; j < size+2; j++)
				this.grid[i][j] = null;
		}
	}
	
	public Aminoacido getGridPos(int i, int j)
	{
		return this.grid[j][i];
	}
	
	public void setGridPos(int i, int j, Aminoacido value)
	{
		this.grid[j][i] = value;
	}
	
	public boolean isPositionOccupied(int i, int j)
	{
		return (this.grid[j][i] != null);
	}
	
	public void refreshGrid()
	{
		int size = grid.length;
		for(int i = 0; i < size; i++)
		{
			for (int j = 0; j < size; j++)
				this.grid[i][j] = null;
		}
	}
	public void imprimeGrid(){
		int size = grid.length;
		for(int i = 0; i < size; i++)
		{
			for (int j = 0; j < size; j++)
				if(this.grid[i][j] != null)
					System.out.print("*");
				else
					System.out.print(" ");
			System.out.println();
		}
	}
}
